﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace APJunktion.ATP.UDPClient.Module.Main.Views
{
    /// <summary>
    /// Interaction logic for Scoreboard.xaml
    /// </summary>
    public partial class Scoreboard : UserControl
    {
        #region Properties
        private string _player1, _player2, _scoreA, _scoreB,
            _set1A, _set2A, _set3A, _set4A, _set5A,
            _set1B, _set2B, _set3B, _set4B, _set5B,
            _speed; 
        #endregion

        #region Public Methods

        public Scoreboard()
        {
            InitializeComponent();
        }

        public void UpdateScore(string player1, string player2,string scoreA,string scoreB,
            string set1A,string set2A,string set3A,string set4A,string set5A,
            string set1B,string set2B,string set3B,string set4B,string set5B)
        {
            _player1 = player1;
            _player2 = player2;
            _scoreA = scoreA;
            _scoreB = scoreB;
            _set1A = set1A;
            _set1B = set1B;
            _set2A = set2A;
            _set2B = set2B;
            _set3A = set3A;
            _set3B = set3B;
            _set4A = set4A;
            _set4B = set4B;
            _set5A = set5A;
            _set5B = set5B;
            UpdateScoreboard();
        }

        public void UpdateSpeed(string speed)
        {
            _speed = speed;
            UpdateSpeedboard();
        }

        #endregion

        #region Private Methods
        private void UpdateScoreboard()
        {
            lblPlayer1.Content = _player1;
            lblPlayer2.Content = _player2;
            lblSet1A.Content = _set1A;
            lblSet1B.Content = _set1B;
            lblSet2A.Content = _set2A;
            lblSet2B.Content = _set2B;
            lblSet3A.Content = _set3A;
            lblSet3B.Content = _set3B;
            lblSet4A.Content = _set4A;
            lblSet4B.Content = _set4B;
            lblSet5A.Content = _set5A;
            lblSet5B.Content = _set5B;
        }

        private void UpdateSpeedboard()
        {
            lblSpeed.Content = _speed;
        } 
        #endregion
    }
}
